import React from 'react'
import {useParams,useLocation,useNavigate} from 'react-router-dom'

function WithRouter(Com) {
  return(props) =>{
    const navigate = useNavigate()
    const location = useLocation()
    const params = useParams()
      return <Com {...props} router={{navigate,location,params}}></Com>
  }
}

export default WithRouter